﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;

namespace NetworkData
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        FriendlyFireLibrary.NetworkAsyncCodeServer server;
       // FriendlyFireLibrary.NetworkAsyncCodeClient client;
        private void Form1_Load(object sender, EventArgs e)
        {
            server = new FriendlyFireLibrary.NetworkAsyncCodeServer(new RSAParameters(), new RSAParameters());
           // client = new FriendlyFireLibrary.NetworkAsyncCodeClient("127.0.0.1", null, "Client " + (server.networkClients.Count + 1));
        }

        private void button1_Click(object sender, EventArgs e)
        {
            for(int i = 0; i < listBox1.SelectedIndices.Count; i++)
                server.SendMessage(txtServerMessage.Text, server.networkClients[listBox1.SelectedIndices[i]].ClientSocket);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            //client.SendMessage(txtClientMessage.Text);
        }
    }
}
